/**
 *
 * Copyright Pact Lab of H.I.T.
 *
 * Designed and Implemented by Grid Researching Group, 
 * Pact Lab, Harbin
 * 
 * This Project is part of the national 973 Project:
 * Internet Based Virtual Computing Environment
 *
 * http://pact518.hit.edu.cn
 * 
 * Author:       Meteor <meteorlxk@gmail.com> 
 * Copyright:    pact518 
 * Version:      1.0
 * Created:      2009-5-5 
 * LastModified: 2009-12-16
 */
package edu.hit.pact.pgse.bean;

import java.io.Serializable;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;

import edu.hit.pact.pgse.crawler.bbs.BBSURL;
import edu.hit.pact.pgse.crawler.util.Anchor;

public class RawWebPage implements Serializable{

	private static final long serialVersionUID = -6767911039158561483L;
	
	private final String urlStr;
	private String pageRawContent;
	private String charSet; 
	private ArrayList<String> commentLinks;	
	private ArrayList<String> anchor;  //add by HCZ 2011.11.26 ,the anchor of one <a> tag, correspond to commentLinks.
	private ArrayList<Anchor> anchorList;
	private HashMap<String,URL> linksAnchor;  //add by HCZ 2011.11.7
	private String text;   // the text romove the html code ,add by HCZ 2011.11.7
	
	private String lastModified;
	private int type;
	private String belongTo;
	private String channel;
	private String place;
	
	
	
	public RawWebPage(String urlStr) {
		this.urlStr = urlStr;
	}
	
	

	public HashMap<String, URL> getLinksAnchor() {
		return linksAnchor;
	}


	public void setLinksAnchor(HashMap<String, URL> linksAnchor) {
		this.linksAnchor = linksAnchor;
	}

	
	
	
	public ArrayList<Anchor> getAnchorList() {
		return anchorList;
	}



	public void setAnchorList(ArrayList<Anchor> anchorList) {
		this.anchorList = anchorList;
	}



	public ArrayList<String> getAnchor() {
		return anchor;
	}



	public void setAnchor(ArrayList<String> anchor) {
		this.anchor = anchor;
	}



	public String getText() {
		return text;
	}



	public void setText(String text) {
		this.text = text;
	}



	/**
	 * @return the urlStr
	 */
	public String getUrlStr() {
		return urlStr;
	}

	/**
	 * @param pageRawContent the pageRawContent to set
	 */
	public void setPageRawContent(String pageRawContent) {
		this.pageRawContent = pageRawContent;
	}

	/**
	 * @param charSet the charSet to set
	 */
	public void setCharSet(String charSet) {
		this.charSet = charSet;
	}

	/**
	 * @return the pageRawContent
	 */
	public String getPageRawContent() {
		return pageRawContent;
	}

	/**
	 * @return the charSet
	 */
	public String getCharSet() {
		return charSet;
	}

	
	/**
	 * @return the lastModified
	 */
	public String getLastModified() {
		return lastModified;
	}

	/**
	 * @param lastModified the lastModified to set
	 */
	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	
	public ArrayList<String> getCommentLinks() {
		return commentLinks;
	}

	public void setCommentLinks(ArrayList<String> commentLinks) {
		this.commentLinks = commentLinks;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getBelongTo() {
		return belongTo;
	}

	public void setBelongTo(String belongTo) {
		this.belongTo = belongTo;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		StringBuffer content = new StringBuffer();
		
		content.append("url is " + urlStr + "\n");
		content.append("content is " + pageRawContent + "\n");
		content.append("contentEncoding is " + charSet + "\n");
		content.append("lastModified time is " + lastModified + "\n");
		content.append("type " + type + "\n");
		content.append("belongTo " + belongTo + "\n");
		content.append("channel " + channel + "\n");
		content.append("place " + place + "\n");
		if( null == commentLinks || commentLinks.isEmpty()){
			content.append("commentLinks is empty \n");	
		} else{
			for(String interLink : commentLinks){
				content.append("interLinkList is " + interLink + "\n");			
			}//end for
		}//end if
		
		return content.toString();
	}
	
	
}
